home *** CD-ROM | disk | FTP | other *** search
- Path: nova.umuc.edu!not-for-mail
- From: srussell@nova.umuc.edu (Steve Russell)
- Newsgroups: comp.lang.c++
- Subject: Class
- Date: 3 Mar 1996 11:35:29 -0500
- Organization: University of Maryland University College
- Message-ID: <4hchoh$ngh@nova.umuc.edu>
- NNTP-Posting-Host: nova.umuc.edu
-
- Well, the day has arrived. My teacher not only has me doing c++ on
- unix, but OBJECT ORIENTATED PROGRAMMING as well ( drum roll abruptley stops).
-
- Its my first program making my own classes so I have a few general questions
- that I didn't think to ask my professor while I had the chance, and as
- usual my text book fails me:
-
- 1. Can I read from and output to files directly from the class? Can
- I include<fstream.h> in the class? Do I need to include other things
- like iostream.h and other various libraries for library functions?
-
-
- 2. I would like to reuse this class so I plan on saving the entire class
- in a seperate file. I plan on running the entire program on unix.
- After I include the header file for the class in the mainprogram is
- there anything else special I have to do?
-
- 3. Is this the right way to right a file for a class in unix:
-
- //FILE: EmpRecords.h
- // MANIPULATES EMPLOYEE RECORDS
- #ifdef EMPLOYEERECORDS_H_
- #define EMPLOYEERECORDS_H_
-
- // class definition, and member function definitions
-
- #endif//end of EmpRecords.h
-
-
- 4. Finally, my class has a struct in it. This struct has a char array in it.
- Do I need to initialize this struct via a constructor function? If so
- would it be sufficent to set all the attributes of the struct to zero
- and give a dummy name to the string?
-
-
- Thanks
- Steve
-